App({
	// 分享好友
	onLaunch: function() {
		this.overShare()
	},
	overShare() {
		wx.onAppRoute((res) => {
			let pages = getCurrentPages()
			let view = pages[pages.length - 1]
			if (view) {
				wx.showShareMenu({
					menus: ['shareAppMessage','shareTimeline'],//设置分享好友功能 可加上shareTimeline分享到朋友圈
					success(res) {},
					fail(e) {}
				})
			}
		})
	},
 
})


/* import {mapState } from 'vuex'
export default {
	data() {
		return {
			weixinShare: {
				path: `pages/index/index`,
				title:"cpdd，同城交友，cp扩列，寻找对象，交朋友，交闺蜜，认识更多有趣的人。90后、00后、05后的高质量处对象处cp的小程序",
				imageUrl:'https://dashu.img.5gtc.net/uploads/20230903/192cb09e9a16600042e5297d48b5accc.png', 
			}
		}
	},
	computed: {
	  ...mapState([
	    'systemInfo',
	  	'config',
	  	'userInfo'
	  ]),
	},
	// 定义全局分享
	// 1.发送给朋友
	onShareAppMessage(res) {
		return {
			title: this.weixinShare.title,
			path: this.weixinShare.path+"INVITER_UID=${this.userInfo.id}",
			imageUrl: this.weixinShare.imageUrl,
		}
	},
	//2.分享到朋友圈
	onShareTimeline(res) {
		return {
			title: this.weixinShare.title,
			path: this.weixinShare.path,
			imageUrl: this.weixinShare.imageUrl,
		}
	},
} */